﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using ScriptManager.Data.Domain.Services;
using ScriptManager.Data.Domain.Interfaces;
using ScriptManager.Data.Utilities;
using ScriptManager.Data.Domain.Entities;


using NHibernate;
using Castle.Facilities.NHibernateIntegration;

namespace ScriptManager.Console
{
    class Program
    {
        static void Main(string[] args)
        {
            Execute exe = new Execute();
            exe.run();
        }
    }

    class Execute
    {
        private IDataService _dataService;
        private ISession _session;

        public void run()
        {
            var container = IoC.Container;

            var f = container.Resolve<ISessionFactory>();
            _session = f.OpenSession();
            _dataService = IoC.Container.Resolve<IDataService>();

            Author author = _dataService.CreateNewAuthor("Nolan", "Sipos");
            _dataService.SaveAuthor(author);
        }
    }
}